//
//  LevelTestCell.m
//  MIDI
//
//  Created by E.M.Game on 15/9/11.
//  Copyright (c) 2015年 QXSX. All rights reserved.
//

#import "LevelTestCell.h"

@interface LevelTestCell()
@property (weak, nonatomic) IBOutlet UIImageView *topImg;
@property (strong, nonatomic) NSArray *aryData;

@end

@implementation LevelTestCell

@synthesize aryData;

- (void)awakeFromNib {
    // Initialization code
    
    UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap)];
    
    [self addGestureRecognizer:tapGestureRecognizer];
    
    self.aryData = [NSArray arrayWithObjects:@"报名考试", @"考级流程",
                       @"公开课视频", @"备考指南", @"考级证书", @"迷笛先生", nil];
}

-(void)tap
{
    if ([self.levelTestCellDelegate respondsToSelector:@selector(clickTitleIndex:)]) {
        
        [self.levelTestCellDelegate clickTitleIndex:[self getIndexByTitle:self.titleLabel.text]];
    }
}

-(int)getIndexByTitle:(NSString*)title
{
    return [self.aryData indexOfObject:title];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    //[super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+(id)loadFromNib
{
    NSString *nibName = NSStringFromClass([self class]);
    return [[[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil] firstObject];
}

@end

























